/*
 * @(#)MaintDmsPersonalStorageSetupForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.dms.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.dms.bean.DmsPersonalStorageSetup;
import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.web.AbstractActionForm;

/**
  MaintDmsPersonalStorageSetupForm.java

  This class is the for web form purpose.

  @author      Jenny Li
  @company     DCIVision Limited
  @creation date   13/12/2004
  @version     $Revision: 1.2 $
*/

public class MaintDmsPersonalStorageSetupForm extends AbstractActionForm {

  public static final String REVISION = "$Revision: 1.2 $";

  private String memberID = null;
  private String memberType = null;
  private String memberName = null;
  private String storageLimit = null;
  private String unlimit = null;

  public MaintDmsPersonalStorageSetupForm() {
    super();
  }

  public String getMemberID() { 
    return(this.memberID);
  }

  public void setMemberID(String memberID) { 
    this.memberID = memberID;
  }

  public String getMemberType() { 
    return(this.memberType);
  }

  public void setMemberType(String memberType) { 
    this.memberType = memberType;
  }
  
  public String getMemberName(){
    return(this.memberName); 
  }
  
  public void setMemberName(String memberName){
    this.memberName=memberName;
  }

  public String getStorageLimit() { 
    return(this.storageLimit);
  }

  public void setStorageLimit(String storageLimit) { 
    this.storageLimit = storageLimit;
  }
  
  public String getUnlimit(){
    return(this.unlimit); 
  }
  
  public void setUnlimit(String unlimit){
    this.unlimit = unlimit; 
  }
  
  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setMemberID(null);
    this.setMemberType(null);
    this.setMemberName(null);
    this.setStorageLimit(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    DmsPersonalStorageSetup tmpDmsPersonalStorageSetup = new DmsPersonalStorageSetup();
    tmpDmsPersonalStorageSetup.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpDmsPersonalStorageSetup.setMemberID(TextUtility.parseIntegerObj(this.getMemberID()));
    tmpDmsPersonalStorageSetup.setMemberType(this.getMemberType());
    tmpDmsPersonalStorageSetup.setMemberName(this.getMemberName());
    tmpDmsPersonalStorageSetup.setStorageLimit(TextUtility.parseDoubleObj(this.getStorageLimit()));
    tmpDmsPersonalStorageSetup.setRecordStatus(this.getRecordStatus());
    tmpDmsPersonalStorageSetup.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpDmsPersonalStorageSetup.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpDmsPersonalStorageSetup.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpDmsPersonalStorageSetup.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpDmsPersonalStorageSetup.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpDmsPersonalStorageSetup;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    DmsPersonalStorageSetup tmpDmsPersonalStorageSetup = (DmsPersonalStorageSetup)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpDmsPersonalStorageSetup.getID()));
    this.setMemberID(TextUtility.formatIntegerObj(tmpDmsPersonalStorageSetup.getMemberID()));
    this.setMemberType(tmpDmsPersonalStorageSetup.getMemberType());
    this.setMemberName(tmpDmsPersonalStorageSetup.getMemberName());
    this.setStorageLimit(TextUtility.formatDoubleObj(tmpDmsPersonalStorageSetup.getStorageLimit()));
    this.setRecordStatus(tmpDmsPersonalStorageSetup.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpDmsPersonalStorageSetup.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpDmsPersonalStorageSetup.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpDmsPersonalStorageSetup.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpDmsPersonalStorageSetup.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpDmsPersonalStorageSetup.getUpdateDate()));
  }
}
